<!--Declaracion del tipo de documento como HTML5-->
<!DOCTYPE html>
<html> 
<head> 
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQuery Mobile: Demos and Documentation</title>
	<link rel="stylesheet"  href="css/themes/default/jquery.mobile-1.2.1.css" />
	<link rel="stylesheet" href="docs/_assets/css/jqm-docs.css" />
	<script src="js/jquery.js"></script>
	<script src="docs/_assets/js/jqm-docs.js"></script>
	<script src="js/jquery.mobile-1.2.1.js"></script>
</head> 
<body> 
	<div data-role="page"> 
	<div data-role="header">
		 <h1>Búsqueda de estudiantes por criterios</h1>
		<a href="index.php" data-role="button" data-icon="home" data-iconpos="notext" data-theme="b" data-iconpos="left" data-inline="true">Inicio</a>
		<a href="#" data-role="button" data-icon="bars" data-iconpos="notext" data-theme="b" data-iconpos="right" data-inline="true">MenÃº</a>		
	</div>	
	<div data-role="content">
		 <form name="busqueda" action="busqueda.php" method="POST">
		  <label for="basic"/>Dato a buscar:</label>
          <input type="text" name="dato" id="basic" value="" required />
    	  <label for="criterio" class="select"/>Criterio a buscar:</label/>
          <select name="criterio" id="criterio"/>
			 <option value="nc"/>N. Control</option/>
             <option value="nom"/>Nombre</option/>      
          </select/>
     	  <input type="submit" name="envio" value="Buscar" />
		 </form>
		 
		 <form name="busqueda" action="busqueda.php" method="POST">
		 <div class="content-primary">
			<?php
			if(isset($_REQUEST["criterio"]) and isset($_REQUEST["dato"])){
    		include('conexion.php');
			$cri=$_REQUEST["criterio"];
		    $dato=$_REQUEST["dato"];
			if ($cri=='nc')
    	       $consulta="select * from alumnos where ncontrol like '%".$dato."%'";
			if ($cri=="nom")
    	       $consulta="select * from alumnos where nombre  like '%".$dato."%'"; 
    	  	$recordset=mysql_query($consulta);
		 
    	  ?>
    	    <ul data-role="listview" data-split-icon="gear" data-split-theme="d">
    	    <?php while ($row=mysql_fetch_array($recordset)){?>
            <li><?php echo '<a href="modalumnos.php?nc='.$row["ncontrol"].'" >';?>
    				<img src="images/ajax-loader.gif" width="20" height="20" />
    				<h3><?php echo $row["nombre"]?></h3>
    				<p><?php echo $row["nombre"]?></p>
    				</a><a href="#purchase" data-rel="popup" data-position-to="window" data-transition="pop"><?php echo $row["nombre"]?></a>				
    		</li>
    		 <?php } }?>	
    		</ul>		
    		<div data-role="popup" id="purchase" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">
    			<h3>Purchase Album?</h3>
    			<p>Your download will begin immediately on your mobile device when you purchase.</p>
    			<a href="index.html" data-role="button" data-rel="back" data-theme="b" data-icon="check" data-inline="true" data-mini="true">Buy: $10.99</a>
    			<a href="index.html" data-role="button" data-rel="back" data-inline="true" data-mini="true">Cancel</a>	
    		</div>
		
		</div><!--/content-primary -->		
		 </form> 	 	 
	</div> 
	<div data-role="footer">
	Instituto Tecnológico de Tlaxiaco
	</div>
</div>
</body>
</html>